package com.zfei.gfb.util;

import java.nio.charset.StandardCharsets;

/**
 * @author fgh
 */
public class Strings {

    public static final String NULL = "null";

    public static byte[] serialize(String string) {
        return (string == null ? null : string.getBytes(StandardCharsets.UTF_8));
    }

    public static String deserialize(byte[] bytes) {
        return (bytes == null ? null : new String(bytes, StandardCharsets.UTF_8));
    }

    public static boolean isEmpty(String string) {
        return string == null || string.isEmpty();
    }

    public static boolean isNotEmpty(String string) {
        return !isEmpty(string);
    }
}
